package zhouzhouyongche.dao;

import java.util.Calendar;
import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import zhouzhouyongche.model.TestDate;

@Repository
public class TestDao extends HibernateDao<TestDate> {

	public List queryWithDate(Calendar calendar) {
		int year = calendar.get(Calendar.YEAR);
		int month = calendar.get(Calendar.MONTH) + 1;
		int day = calendar.get(Calendar.DAY_OF_MONTH);
		
		String hql = "select year(t.date), month(t.date), day(t.date) "
				+ "from TestDate as t";
		Query q = getCurrentSession().createQuery(hql);
		
		
		return q.list();
	}
	
	
}
